package com.interview.item.javabase.exception;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Author:zxh
 * @Description:
 * @Date: 2020/4/9
 * @Modified By:
 */
public class ExceptionDemo {
   static Logger logger = LoggerFactory.getLogger(ExceptionDemo.class);
    public static void one(String string)throws Exception{
        if (string == null) {
            throw new Exception("空指针");
        }
        return;
    }

    public static void main(String[] args) {
        try {
            ExceptionDemo.one(null);
        }catch (Exception e){
            logger.error("输出：{}",e);
        }
    }
}
